package homework04;

public class CalculatorDemo {
    public static void main(String[] args) {
    useCalculator(new Calculator() {
        @Override
        public int calc(int num) {
            return num;
        }
    });
    //简写
        System.out.println(useCalculator(num -> 10));

    }
    public static int useCalculator(Calculator cal){
        return cal.calc(10);
    }
}
